<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <title>首页</title>
    <link rel="stylesheet" href="../../css/api.css">
    <link rel="stylesheet" href="../../css/main.css">
    <link rel="stylesheet" href="../../css/vant.css">
    <style>
        .xiangqing .detail .preview-img img{
            width: 3.51rem;
            height: 1.37rem;
        }
        .intro {
            margin-top: .2rem;
            width: 100%;
        }
        .intro img {
            max-width: 100%;
        }
    </style>
</head>

<body>
    <div class="app" v-cloak>
        <div class="xiangqing">
            <div class="main">
                <div class="detail">
                    <div class="preview-img">
                        <img v-if="objInsure.imageUrl" v-lazy="objInsure.imageUrl" alt="">
                    </div>
                    <div class="intro" v-html="objInsure.intro"> </div>
                </div>
            </div>
        </div>

    </div>

    <script src="../../script/api.js "></script>
    <script src="../../script/flexible.js "></script>
    <script src="../../script/fastclick.js "></script>
    <script src="../../script/vue.min.js "></script>
    <script src="../../script/iconfont.js "></script>

    <script src="../../script/vant.min.js"></script>
    <script src="../../script/common.js "></script>
    <script src="../../script/businessCommon.js "></script>
    <script src="../../script/restful.js "></script>
    <script src="../../script/vue-lazyload.js"></script>
    <script>
        apiready = function() {
            imgLazyLoad();
            var vm = new Vue({
                el: '.app',
                data() {
                    return {
                        objInsure:{},
                        module: 'INSURANCE',
                        id: api.pageParam.item.id,
                        kfUrl:'',
                    }
                },
                mounted() {
                    this.getInsuranceDetail();
                },
                methods: {
                    call(){
                        var phone = this.objInsure.phone.split(',')
                        api.actionSheet({
                            cancelTitle: '取消',
                            buttons: phone
                        },function(ret,err){
                            if(ret.buttonIndex > phone.length) return false;
                            api.call({
                                type: 'call_type',
                                number: phone[ret.buttonIndex-1]
                            });
                        });
                    },
                    getInsuranceDetail() {
                        const vm = this;
                        index.mergeInsure("getInsuranceDetail")(api.pageParam.item, function(ret) {
                            vm.objInsure = ret.data
                        })
                    },
                },
            })
            api.addEventListener({
                name: 'sendFinanc'
            }, function (ret, err) {
                var type = ret.value.type
                if (type == 'call') {
                    if (!checkToken()) return false;
                    vm.call()
                } else if (type == 'goIM') {
                    gIMCommon(vm.objInsure.userId)
                }
            });
        }
    </script>
</body>

</html>